package com.cn.vo;

import com.cn.utils.ResultCode;
import lombok.Data;

/**
 * Created by chenyuncong on 2019/9/16.
 */
@Data
public class ReJson<T> {
    private int code;
    private String msg;
    private T data;

    public static ReJson OK(){
        return new ReJson(200,ResultCode.SUCCESS.getMsg(),"");
    }

    public ReJson(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ReJson(T data) {
        this.data = data;
        this.code=ResultCode.SUCCESS.getCode();
        this.msg=ResultCode.SUCCESS.getMsg();
    }
}
